<h1> User Module: Assign Roles to User </h1>

<?if ($this->saved) :?> 
<br/>
<b>
Roles saved </b>
<br/>

<?endif ?>

<hr/>

User: <b><?=$this->uname ?></b> <br/>
<form accept-charset="UTF-8" action="/en/user/admin/assign-roles"
      method="POST">
<table width="100%">

<tr style="background-color:#EEEEEE">
<td>#</td>
<td width="50%"> <b>Role Name</b> </td>
<td> </td>
</tr>

<?foreach ($this->allRoles as $role):?>


<tr>
<td width="5%"><?=$role['rid'] ;?></td> 
<td width="50%"><?=$role['rname']; ?></td>
<td width="40%">
<?if (in_array($role['rid'], $this->userRoleIds)) 
:?>
<input type="checkbox" checked value="<?=$role['rid']?>" name="assigningRoles <?=$role['rid']?>"/>
<?else:?>
<input type="checkbox" value="<?=$role['rid']?>" name="assigningRoles <?=$role['rid']?>"/>
<?endif?>

</td>
</tr>


<?endforeach ?>
</table>
<br/>
<input type="submit" class="form-submit" value="Save permissions" id="edit-submit" name="op"/>
<input type="hidden" id="uid" name="uid" value="<?=$this->uid?>"/>
<input type="hidden" id="uname" name="uname" value="<?=$this->uname?>"/>
</form>      